﻿@using DNA.OpenAPI.Rss;
@model IEnumerable<RssItem>
<ul class="ui-helper-reset" style="padding: 10px;">
    @foreach (var item in Model)
    {
        <li>
            <table>
                <tr>
                    <td>
                        @if (item.Enclosure != null)
                        {
                            if (!string.IsNullOrEmpty(item.Enclosure.ContentType) &&
                                item.Enclosure.ContentType.StartsWith("image", StringComparison.OrdinalIgnoreCase) &&
                                !string.IsNullOrEmpty(item.Enclosure.Url))
                            {
                            <div class="d-avatar">
                                <img src="@item.Enclosure.Url" alt="@item.Enclosure.Url" />
                            </div>
                            }
                        }
                    </td>
                    <td style="vertical-align: top;padding:5px;">
                        <h3 class="d-post-title">
                            <a href="@item.Link" title="@item.Title" target="_blank" rel="nofollow">@Html.Cut(item.Title, (int)ViewData["TextLen"])</a>
                        </h3>
                        <div class="d-post-summary" title="@item.Description" style="margin:0px;">
                            @Html.Cut(TextEngine.Text(item.Description), 255)
                        </div>
                        <ul class="d-horizontal-list">
                            @if ((bool)ViewData["ShowAuthor"] && !string.IsNullOrEmpty(item.Author))
                            {  
                                <li style="color: #cccccc; font-style: italic">@Html.Global("RES_POSTBY") @item.Author
                                </li>
                            }
                            @if ((bool)ViewData["ShowDate"] && (!string.IsNullOrEmpty(item.PubDate)))
                            { 
                                <li style="color: #cccccc; font-style: italic">
                                    @item.PubDate
                                </li>
                            }
                            @if ((item.Categories != null) && (item.Categories.Count > 0))
                            {
                                foreach (var cat in item.Categories)
                                {
                                <li>@cat.Text</li>
                                }
                            }
                        </ul>
                    </td>
                </tr>
            </table>
        </li>   
    }
</ul>
